
public class AObject : Object {
	public virtual string name { get; set; }
	public int age{ get; set; }
}

public class BObject : AObject {
	public override string name { get; set; default = "b"; }
}

string func3() {
	return "myfunc";
}

async string func2() {
	func3();
	return "42";
}

async int func() {
	func3();
	int i = int.parse(yield func2());
	func3();
	return i;
}

public class App : Object {
	public static int main(string[] args) {
		MainLoop main_loop = new MainLoop();
		//Value v = Value(typeof(void*));
		//debug("value = %s, %d", v.strdup_contents(), v == null);
		func.begin((obj, result) => {
			int a = func.end(result);
			
			debug("%d", a);
			main_loop.quit();
		});
		/*var a = new AObject();
		var b = new BObject();
		var c = b as AObject;
		debug("a = %s, b = %s, c = %s", a.name, b.name, c.name);
		debug("b = %s", b.get_type().name());*/
		//print(a.name);
		Value d = Value(typeof(string));
		debug("d = %s", d.strdup_contents());
		
		main_loop.run();
		
		return 0;
	}
}

